package com.ssy.lingxi.marketing.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  营销活动-操作记录-固定描述
 * @author ds
 * @date 2022/2/15
 * @version 2.0.0
 */
public enum ActivityStrOperateEnum {

    /**[1,100]平台活动 */
    //平台外部
    pt_outer_add (1,"新增平台营销活动"),
    pt_outer_cancel (2,"取消"),
    pt_outer_stop(3,"终止"),
    pt_outer_restart(4,"重新启动"),
    pt_outer_online(5,"上线活动"),
    pt_outer_audit_signup(6,"审核报名"),

    pt_outer_submit_signup (7,"提交报名资料"),


    //平台内部
    pt_inner_add (21,"新增平台营销活动"),
    pt_inner_cancel (22,"取消"),
    pt_inner_stop(23,"终止"),
    pt_inner_restart(24,"重新启动"),
    pt_inner_online(25,"审核平台营销活动(二级)"),
    pt_inner_audit_signup(26,"审核报名"),
    pt_inner_submit(27,"提交审核平台营销活动"),
    pt_inner_examine_step1(28,"审核平台营销活动(一级)"),
    pt_inner_examine_step2(29,"审核平台营销活动(二级)"),
    pt_inner_signup_save(30,"填写报名资料"),
    pt_inner_signup_update(31,"修改报名资料"),
    pt_inner_signup_submit(32,"提交审核"),
    pt_inner_signup_examine_step1(33,"审核报名资料(一级)"),
    pt_inner_signup_examine_step2(34,"审核报名资料(二级)"),
    pt_inner_signup_submit_to_platform(35,"提交报名资料"),


    /**[101,200]商家活动 */
    mc_inner_add(101,"新增营销活动"),
    mc_inner_submit_audit(102,"提交审核"),
    mc_inner_examine_step1(103,"审核营销活动(一级)"),
    mc_inner_examine_step2(104,"审核营销活动 (二级)"),
    mc_inner_submit(105,"提交营销活动"),
    mc_inner_online(106,"上线营销活动"),
    mc_inner_stop(107,"终止"),
    mc_inner_restart(108,"重新启动"),
    ;
    private final Integer code;
    private final String message;

    ActivityStrOperateEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(ActivityStrOperateEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(ActivityStrOperateEnum::getMessage).orElse("");
    }


}
